<template>
  <el-form :model="form" label-width="auto" style="max-width: 300px">
    <el-form-item label="用户昵称">
      <el-input v-model="form.name" />
    </el-form-item>
    <el-form-item label="手机号码">
      <el-input v-model="form.phone" />
    </el-form-item>
    <el-form-item label="邮箱">
      <el-input v-model="form.email" />
    </el-form-item>
    <el-form-item label="性别">
      <el-radio-group v-model="form.sex">
        <el-radio value="man" >男</el-radio>
        <el-radio value="women">女</el-radio>
      </el-radio-group>
    </el-form-item>
    <el-form-item>
      <el-button type="primary" @click="onSubmit">保存</el-button>
      <el-button type="danger" @click="logout">关闭</el-button>
    </el-form-item>
  </el-form>
</template>

<script setup>
import { reactive } from 'vue'
import { ElMessage } from 'element-plus';
import { useRouter } from 'vue-router';
const router = useRouter()
const form = reactive({
  name: 'czh',
  phone: '1523903',
  email: '552639550@qq.com',
  sex: 'man'
})

const onSubmit = () => {
  ElMessage({
            type: 'success',
            message: '保存成功！',
        })
}
const logout = () => {
  router.push('/index');
}
</script>

<style scoped>

</style>